var imgLoaded = true;
$(function () {

    var startNum = 0;   // 每次请求时，图片从第几张开始加载。
    var limitNum = 10;   // 每次请求时，图片加载的数量。

    var Ourl = httpHost + "/Money/getPayinRecord?start=" + startNum + "&limit=" + limitNum;
    loadArts(Ourl, startNum);

    $(window).scroll(function () {
        if (($(window).height() + document.body.scrollTop)+10 >= document.body.scrollHeight) {
            if (imgLoaded) {
                startNum += limitNum;
                Ourl = httpHost + "/Money/getPayinRecord?start=" + startNum + "&limit=" + limitNum;
                imgLoaded = false;
                loadArts(Ourl, startNum);
            }
        }
    });

});

function appendLi(data) {

    console.log(data);

    if(data.more == 0 || data.more == null){
        $(".load-more").hide();
    }else{
        $(".load-more").show();
        imgLoaded = true;
    }

    if(data.count == 0){
        $(".artfin_no_style").show();
    }else{
        for (var i = 0; i < data.list.length; i++) {
            var jsondata = data.list[i];
            if(jsondata.type == 2){
                var Dhtml = '<dl><dt class="color_style">'+ jsondata.amount +'</dt><dd>'+ jsondata.stage_name +'</dd><dd><time>'+ jsondata.created +'</time></dd></dl>';
            }else{
                if(jsondata.type_id == 1){
                    var Dhtml = '<dl style="height: 150px;"><dt>'+ jsondata.amount +'</dt><dd>'+ jsondata.stage_name +'</dd><dd><span style="font-size: 24px;color: #888;">订单号： '+ jsondata.sn +'</span></dd><dd><time>'+ jsondata.created +'</time></dd></dl>';
                }else{
                    var Dhtml = '<dl><dt>'+ jsondata.amount +'</dt><dd><time>'+ jsondata.created +'</time></dd></dl>';
                }
            }
            $(".money_news").append(Dhtml);
        }
    }

}